<template>
	<view class="page">
		<u-back-top :scroll-top="scrollTop" icon="arrow-up"></u-back-top>
		<view class="nav">
			<image src="../../static/img/logo.png" mode=""></image>
			<text>工作台</text>
		</view>
		<view class="nav-bottom">

		</view>
		<!-- 常用功能 -->
		<view class="content">
			
	
		<view class="Common-functions">
			<view class="Common-top">
				<view class="hong"></view>
				<view class="Common-item-title">常用功能</view>
				<view class="Common-item-right">
					<view class="Common-item-text">添加应用</view>
					<image src="../../static/img/jt@2x.png" alt="" />
				</view>
			</view>
			<view class="Common-content">
				<view class="Common-item" v-for="(item,index) in commonlyUsedList" :key="index">
					<view class="item-img">
						<image :src="item.imgIp" mode=""></image>
					</view>
					<view class="item-text">{{item.name}}</view>
				</view>
			</view>

		</view>
		<!-- 医械通 -->
		<view class="Common-functions">
			<view class="Common-top">
				<view class="hong"></view>
				<view class="Common-item-title">医械通</view>
			</view>
			<view class="Common-content">
				<view class="Common-item" v-for="(item,index) in yixieList" :key="index">
					<view class="item-img">
						<image :src="item.imgIp" mode=""></image>
					</view>
					<view class="item-text">{{item.name}}</view>
				</view>
			</view>

		</view>
		<!-- 商机 -->
		<view class="Common-functions">
			<view class="Common-top">
				<view class="hong"></view>
				<view class="Common-item-title">商机</view>
			</view>
			<view class="Common-content">
				<view class="Common-item" v-for="(item,index) in shangjiList" :key="index">
					<view class="item-img" @click="click(item.name)">
						<image :src="item.imgIp" mode=""></image>
					</view>
					<view class="item-text">{{item.name}}</view>
				</view>
			</view>

		</view>
		<!-- 服务 -->
		<view class="Common-functions">
			<view class="Common-top">
				<view class="hong"></view>
				<view class="Common-item-title">服务</view>
			</view>
			<view class="Common-content">
				<view class="Common-item" v-for="(item,index) in fuwuList" :key="index">
					<view class="item-img" >
						<image :src="item.imgIp" mode=""></image>
					</view>
					<view class="item-text">{{item.name}}</view>
				</view>
			</view>

		</view>
			</view>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				scrollTop: 0,
				user_yy: '7,8,9,17,18,15',
				user_yx: '4,6,7,8,9',
				user_sj: '13,14,15,19,17,18,20,21',
				user_fu: '2',
				yixieList: [],
				shangjiList: [],
				fuwuList: [],
				baseDir: "",
				commonlyUsedList: [],
				allUseItem: [
					// {
					//     id: 1,
					//     name: '信息发布',
					//     selected: false,//是否为常用功能
					//     belongTo: 'service',
					//     path:baseDir+'/service/release',
					//     isOut:false,//是否跳转外链
					//     outPath:''
					// },
					{
						id: 2,
						name: '发布列表',
						selected: false,
						belongTo: 'service',
						path: '/service/releaseList',
						isOut: false,
						imgIp: "../../static/img/user2.png",
						outPath: ''
					},
					// {
					//     id: 3,
					//     name: '我的积分',
					//     selected: false,
					//     belongTo: 'service',
					//     path:baseDir+'/service/integral',
					//     isOut:false,
					//     outPath:''
					// },
					{
						id: 4,
						name: '完善信息',
						selected: false,
						belongTo: 'medicine',
						path: '/medicine/info',
						isOut: false,
						imgIp: "../../static/img/user4.png",
						outPath: ''
					},
					// {
					//     id: 5,
					//     name: '医械订阅',
					//     selected: false,
					//     belongTo: 'medicine',
					//     path:'',
					//     isOut:true,
					//     outPath:''
					// },
					{
						id: 6,
						name: '医疗招标搜索',
						selected: false,
						belongTo: 'medicine',
						path: '',
						isOut: true,
						imgIp: "../../static/img/user6.png",
						outPath: '/home/search/index.html',
						params: {
							medicalTpe: 2
						}
					},
					{
						id: 7,
						name: '找医疗机构',
						selected: false,
						belongTo: 'medicine',
						path: '',
						isOut: true,
						outPath: '/home/search/index.html',
						imgIp: "../../static/img/user7.png",
						params: {
							medicalTpe: 2,
							activeName: 'fifth'
						}
					},
					{
						id: 8,
						name: '找经销商',
						selected: false,
						belongTo: 'medicine',
						path: '',
						isOut: true,
						outPath: '/home/search/index.html',
						imgIp: "../../static/img/user8.png",
						params: {
							medicalTpe: 2,
							activeName: 'fourth'
						}
					},
					{
						id: 9,
						name: '市场洞察',
						selected: false,
						belongTo: 'medicine',
						path: '/medicine/market',
						imgIp: "../../static/img/user9.png",
						isOut: false,
						outPath: ''
					},
					// {
					//     id: 10,
					//     name: '修改密码',
					//     selected: false,
					//     belongTo: 'setting',
					//     path:baseDir+'/setting/password',
					//     isOut:false,
					//     outPath:''
					// },
					// {
					//     id: 11,
					//     name: '账号信息维护',
					//     selected: false,
					//     belongTo: 'setting',
					//     path:baseDir+'/setting/account',
					//     isOut:false,
					//     outPath:''
					// },
					// {
					//     id: 12,
					//     name: '身份信息维护',
					//     selected: false,
					//     belongTo: 'setting',
					//     path:baseDir+'/setting/identity',
					//     isOut:false,
					//     outPath:''
					// },
					{
						id: 13,
						name: '订阅列表',
						selected: false,
						belongTo: 'opportunity',
						path: '/opportunity/subscriptionList',
						imgIp: "../../static/img/user13.png",
						isOut: false,
						outPath: ''
					},
					{
						id: 14,
						name: '订阅设置',
						selected: false,
						belongTo: 'opportunity',
						path: '/opportunity/setting',
						imgIp: "../../static/img/user14.png",
						isOut: false,
						outPath: ''
					},
					{
						id: 15,
						name: '推送设置',
						selected: false,
						belongTo: 'opportunity',
						path: '/opportunity/push',
						imgIp: "../../static/img/user15.png",
						isOut: false,
						outPath: ''
					},
					// {
					//     id: 16,
					//     name: '搜索',
					//     selected: false,
					//     belongTo: 'opportunity',
					//     path:'',
					//     isOut:true,
					//     outPath:'/home/search/index.html'
					// },
					{
						id: 17,
						name: '项目进度监控',
						selected: false,
						belongTo: 'opportunity',
						path: '/opportunity/projectSchedule',
						imgIp: "../../static/img/user17.png",
						isOut: false,
						outPath: ''
					},
					{
						id: 18,
						name: '企业情报监控',
						selected: false,
						belongTo: 'opportunity',
						path: '/opportunity/intelligence',
						imgIp: "../../static/img/user18.png",
						isOut: false,
						outPath: ''
					},
					{
						id: 19,
						name: '业主监控',
						selected: false,
						belongTo: 'opportunity',
						path: '/opportunity/owner',
						imgIp: "../../static/img/user19.png",
						isOut: false,
						outPath: ''
					},
					{
						id: 20,
						name: '收藏列表',
						selected: false,
						belongTo: 'opportunity',
						path: '/opportunity/collectionList',
						imgIp: "../../static/img/user20.png",
						isOut: false,
						outPath: ''
					},
					{
						id: 21,
						name: '我的客户',
						selected: false,
						belongTo: 'opportunity',
						path: '/opportunity/client',
						imgIp: "../../static/img/user21.png",
						isOut: false,
						outPath: ''
					},
					// {
					//     id: 22,
					//     name: '潜在项目预测',
					//     selected: false,
					//     belongTo: 'opportunity',
					//     path:'',
					//     isOut:true,
					//     outPath:'/home/search/index.html',
					//     params:{activeName:'seventh'}
					// },
					// {
					//     id: 23,
					//     name: '潜在客户挖掘',
					//     selected: false,
					//     belongTo: 'opportunity',
					//     path:'/setting/identity',
					//     isOut:false
					// },
					// {
					//     id: 24,
					//     name: '潜在竞争对手',
					//     selected: false,
					//     belongTo: 'opportunity',
					//     path:'/setting/identity',
					//     isOut:false
					// },
					// {
					//     id: 25,
					//     name: '合作伙伴挖掘',
					//     selected: false,
					//     belongTo: 'opportunity',
					//     path:'/setting/identity',
					//     isOut:false
					// },
					// {
					//     id: 26,
					//     name: '会员购买记录',
					//     selected: false,
					//     belongTo: 'property',
					//     path:baseDir+'/property/memberbuyList',
					//     isOut:false,
					//     outPath:''
					// },
					// {
					//     id: 27,
					//     name: '已用抵扣码',
					//     selected: false,
					//     belongTo: 'property',
					//     path:baseDir+'/property/alreadyDeduction',
					//     isOut:false,
					//     outPath:''
					// },
					// {
					//     id: 28,
					//     name: '抵扣码',
					//     selected: false,
					//     belongTo: 'property',
					//     path:baseDir+'/property/notyetDeduction',
					//     isOut:false,
					//     outPath:''
					// },
					// {
					//     id: 29,
					//     name: '兑换抵扣码',
					//     selected: false,
					//     belongTo: 'property',
					//     path:baseDir+'/property/exchangeDeduction',
					//     isOut:false,
					//     outPath:''
					// },
					// {
					//     id: 30,
					//     name: '数据导出记录',
					//     selected: false,
					//     belongTo: 'data',
					//     path:baseDir+'/data/dataExportList',
					//     isOut:false,
					//     outPath:''
					// },
					// {
					//     id: 31,
					//     name: '数据定制服务',
					//     selected: false,
					//     belongTo: 'data',
					//     path:'',
					//     isOut:true,
					//     outPath:'/home/bigdata/open.html'
					// },
					// {
					//     id: 32,
					//     name: '数据导出平台',
					//     selected: false,
					//     belongTo: 'data',
					//     path:'',
					//     isOut:true,
					//     outPath:'/home/bigdata/export.html'
					// },
					// {
					//     id: 33,
					//     name: '处理记录',
					//     selected: false,
					//     belongTo: 'opportunity',
					//     path:baseDir+'/opportunity/handleList',
					//     isOut:false,
					//     outPath:''
					// },
					// {
					//     id: 34,
					//     name: '标书制作',
					//     selected: false,
					//     belongTo: 'service',
					//     path:'',
					//     isOut:true,
					//     outPath:'/home/service/writeBid.html'
					// },
					// {
					//     id: 35,
					//     name: '企业认证服务',
					//     selected: false,
					//     belongTo: 'service',
					//     path:'',
					//     isOut:true,
					//     outPath:'/home/service/cert.html'
					// },
				],
			}
		},
		// onLoad() {
		// this.user_yy.forEach(item => {
		// 				console.log(item);
		// 				// 遍历数组的每个元素，并执行相应的操作
		// 			});
		// 		},
		onLoad() {
			this.user_yy.split(',').forEach(item => {
				this.allUseItem.forEach(item1 => {
					if (item == item1.id) {
						this.commonlyUsedList.push(item1)
					}
				})
			});
			this.user_yx.split(',').forEach(item => {
				this.allUseItem.forEach(item1 => {
					if (item == item1.id) {
						this.yixieList.push(item1)
					}
				})
			});
			this.user_sj.split(',').forEach(item => {
				this.allUseItem.forEach(item1 => {
					if (item == item1.id) {
						this.shangjiList.push(item1)
					}
				})
			});
			this.user_fu.split(',').forEach(item => {
				this.allUseItem.forEach(item1 => {
					if (item == item1.id) {
						this.fuwuList.push(item1)
					}
				})
			});
		},
		onPageScroll(e) {
			this.scrollTop = e.scrollTop;

		},
		methods: {
           click(e){
			   if(e=="业主监控"){
				   uni.navigateTo({
				   	url:'/pages/monitoring/monitoring'
				   })
			   }else if(e=="项目进度监控"){
				   uni.navigateTo({
				   	url:'/pages/project/project'
				   })
			   }else if(e=="企业情报监控"){
				   uni.navigateTo({
				   	url:'/pages/enterprise/enterprise'
				   })
			   }else if(e=="收藏列表"){
				   uni.navigateTo({
				   	url:'/pages/favorite/favorite'
				   })
			   }else if(e=="我的客户"){
				   uni.navigateTo({
				   	url:'/pages/client/client'
				   })
			   }
		   }
		}
	}
</script>

<style scoped lang="scss">
	.page {
		min-height: 100vh;
		background-color: #EEF0F6;
		padding-bottom: 30rpx;

		.nav {
			height: 176rpx;
			background-image: url('../../static/img/index_t.png');
			background-size: cover;
			padding-top: 88rpx;
			text-align: center;
			line-height: 88rpx;
			font-family: PingFang SC;
			font-weight: 600;
			font-size: 36rpx;
			color: #FFFFFF;
			position: sticky;
			top: 0;
			z-index: 999999;

			image {
				width: 145rpx;
				height: 72rpx;
				position: absolute;
				bottom: 10rpx;
				left: 30rpx;
			}
		}
.content{
	position: relative;
	top: -176rpx;
	margin-bottom: 30rpx;
	z-index: 999;
	width: 690rpx;
	margin: 0 auto;
}
		.nav-bottom {
			// width: 100%;
			height: 202rpx;
			background-image: url('../../static/img/index_b.png');
			background-size: cover;
			position: sticky;
			top: 176rpx;
			left: 0;
			// z-index: 999999;
			// z-index: 1000;
			// position: relative;
			// top:0rpx
		}

		.Common-functions {
			
			width: 690rpx;
			// height: 452rpx;
			background: #FFFFFF;
			border-radius: 16rpx;
			margin-top: 30rpx;
		}

		.Common-top {
			padding: 30rpx 30rpx 0 30rpx;
			// display: inline-block;
		}

		.hong {
			width: 6rpx;
			height: 24rpx;
			background: #F43107;
			margin-top: 8rpx;
			margin-right: 10rpx;
			display: inline-block;
		}

		.Common-item-title {
			height: 40rpx;
			font-family: PingFang SC;
			font-weight: 500;
			font-size: 28rpx;
			color: #333333;
			line-height: 40rpx;
			display: inline-block;
		}

		.Common-item-right {
			display: inline-block;
			float: right;

			image {
				width: 12rpx;
				height: 20rpx;
				margin-left: 10rpx;
			}
		}

		.Common-item-text {
			// width: 112rpx;
			height: 40rpx;
			font-family: PingFang SC;
			font-weight: 400;
			font-size: 28rpx;
			color: #3897F9;
			line-height: 40rpx;
			display: inline-block;
		}

		.Common-content {

			display: flex;
			flex-wrap: wrap;
			padding-bottom: 30rpx;
			// justify-content: space-between;
		}

		.Common-item {
			margin-top: 30rpx;
			width: 172.5rpx;
			height: 146rpx;
		}

		.item-img {
			width: 92rpx;
			height: 92rpx;
			margin: 0 auto;

			image {
				width: 100%;
				height: 100%;
			}
		}

		.item-text {
			width: 172.5rpx;
			height: 34rpx;
			font-family: PingFang SC;
			font-weight: 400;
			font-size: 24rpx;
			color: #333333;
			line-height: 34rpx;
			margin-top: 20rpx;
			text-align: center;
		}

	}
</style>